import { useAccount } from "../store/user";
// 元素权限控制
const permit = {
  mounted(el: HTMLDivElement) {
    console.log("permit指令被挂载了");
    let permitArr = ["超级管理员", "管理员"];
    let user = useAccount();
    let disp = permitArr.includes(user.userInfo?.name!) ? "block" : "none";
    el.style.display = disp;
  },
};

// 别的指令
const hello = {
  mounted() {
    console.log("hello指令被挂载了");
  },
};

export default {
  permit,
  hello,
};
